package com.achievo.know.domain;

import java.util.List;

import com.dayatang.domain.BaseEntityRepository;

/**
 * @author lingen.liu
 * 帐户仓储
 */
public interface UserRepository  extends BaseEntityRepository<User, Long> {
	
	/**
	 * add by vakin.jiang 2010.4.28
	 * 根据角色查询与之关联的所有账户集合
	 * @param fe
	 * @return
	 */
	public List<User> queryAccountByRole(Role role);
	
	public boolean isEmailExist(String email);
	
	public boolean isUsernameExist(String username);
	
	public User getWithRole(String username);
	
	public User get(String username);

	public User get(String userName, boolean isLocal);

	public void createUser(User user);

	public void bulkSave(List<User> users, Role commonEmp);
	
	public void bulkDisable(List<User> users);

	public void batchDelete(String[] ids);

	public void addRole(Long id, Long emp);

	public List<String> findAllUsername();
}
